/*
 * @Author: your name
 * @Date: 2020-09-01 11:47:54
 * @LastEditTime: 2020-09-01 14:59:50
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \react-hkzf-mobile\src\utils\auth.js
 */
const TOKEN_NAME = 'hkzf_token'

// 获取 token
const getToken = () => localStorage.getItem(TOKEN_NAME)

// 设置 token
const setToken = value => localStorage.setItem(TOKEN_NAME, value)

// 删除 token
const removeToken = () => localStorage.removeItem(TOKEN_NAME)

// 是否登录（有权限）
const isAuth = () => !!getToken()

export { getToken, setToken, removeToken, isAuth }